Skip to content

fix: restrict workflow_dispatch to main branch#13

Merged
TerrifiedBug merged 16 commits intomainfrom
feat/dev-binary-channel
Mar 5, 2026
Merged

fix: restrict workflow_dispatch to main branch#13
TerrifiedBug merged 16 commits intomainfrom
feat/dev-binary-channel

Conversation

@TerrifiedBug
Copy link
Owner

Summary

  • Restrict workflow_dispatch builds to refs/heads/main only
  • Prevents feature branch dispatches from overwriting dev Docker images and the rolling dev pre-release with non-main code

Test plan

  • gh workflow run ci.yml --ref main triggers all build jobs
  • gh workflow run ci.yml --ref feat/some-branch only runs lint

TerrifiedBug and others added 16 commits March 5, 2026 15:59
- Replace "dev-unknown" fallback with null to prevent false update
  notifications for dev agents when version string can't be fetched
- Add missing Prisma migration for latestDevAgentRelease fields
- Add comment clarifying VF_CHANNEL is documentation-only
The agent infers its channel from the version string prefix (dev- vs
semver). Writing VF_CHANNEL to the env file served no purpose.
Previously, checksums fetched from GitHub were only held in memory.
After a server restart within the 24h cache window, the version was
loaded from the DB but checksums were empty, causing agent self-update
checksum verification to fail.

Store checksums as JSON in SystemSettings for both stable and dev
channels, and load them on cache hits.
- Always update checkedAt when dev release fetch succeeds, even if
  dev-version.txt is missing, to prevent GitHub API rate limit exhaustion
- Add concurrency group to agent-dev-binaries CI job to prevent race
  conditions on concurrent pushes to main
- Guard stable tag construction against null version to avoid "vnull" URL
The paths filter on the push trigger prevented CI from running when the
workflow file itself was modified in a merge commit (GitHub evaluates
against the pre-merge workflow). Removing it ensures dev binary builds
run on every push to main, matching the design intent.

Also adds workflow_dispatch for manual triggering.
The push-gated jobs (images, dev binaries) excluded workflow_dispatch
events, so manual triggers only ran lint. Now all build jobs run on
both push and workflow_dispatch.
Prevent manual dispatches from feature branches from overwriting the
dev release and Docker images with non-main code.
@greptile-apps
Copy link

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR adds a github.ref == 'refs/heads/main' guard to the workflow_dispatch condition in all three dev-build jobs (server-image, agent-image, agent-dev-binaries), preventing feature-branch manual dispatches from overwriting the :dev Docker images and the rolling dev pre-release.

  • The fix is applied consistently across all three affected jobs; the tag-gated agent-binaries and release jobs require no change since they are already guarded by startsWith(github.ref, 'refs/tags/v').
  • The check (lint + type-check) job is intentionally left unrestricted so it can still be dispatched on any branch for quick CI feedback.
  • All existing trigger paths (push to main, push to a v* tag, workflow_dispatch on main) continue to behave identically to before the change.
  • Note: GitHub Actions does not support a branches: filter on the workflow_dispatch trigger in the on: block, so the job-level if: condition is the correct and only way to achieve this guard.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, correct CI-only change with no application code impact.
  • The change is three near-identical, low-risk condition additions in a workflow file. The logic has been verified across all five trigger scenarios (PR, push-to-main, push-to-tag, dispatch-on-main, dispatch-on-feature-branch) and behaves correctly in each case. No application code, secrets, or runtime behaviour are affected.
  • No files require special attention.

Last reviewed commit: d51655c

@TerrifiedBug TerrifiedBug merged commit fff7d8e into main Mar 5, 2026
1 check passed
@TerrifiedBug TerrifiedBug deleted the feat/dev-binary-channel branch March 5, 2026 17:22
@github-actions github-actions bot added fix ci and removed fix labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant